Optimal. Leaf size=97 \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}-\frac{2 a b \cos (c+d x)}{d}+\frac{2 b^2 x \sin (c+d x)}{d^2}+\frac{2 b^2 \cos (c+d x)}{d^3}-\frac{b^2 x^2 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.163103, antiderivative size = 97, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 7, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.368, Rules used = {3339, 2638, 3297, 3303, 3299, 3302, 3296} \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}-\frac{2 a b \cos (c+d x)}{d}+\frac{2 b^2 x \sin (c+d x)}{d^2}+\frac{2 b^2 \cos (c+d x)}{d^3}-\frac{b^2 x^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3339
Rule 2638
Rule 3297
Rule 3303
Rule 3299
Rule 3302
Rule 3296
Rubi steps
\begin{align*} \int \frac{\left (a+b x^2\right )^2 \sin (c+d x)}{x^2} \, dx &=\int \left (2 a b \sin (c+d x)+\frac{a^2 \sin (c+d x)}{x^2}+b^2 x^2 \sin (c+d x)\right ) \, dx\\ &=a^2 \int \frac{\sin (c+d x)}{x^2} \, dx+(2 a b) \int \sin (c+d x) \, dx+b^2 \int x^2 \sin (c+d x) \, dx\\ &=-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x^2 \cos (c+d x)}{d}-\frac{a^2 \sin (c+d x)}{x}+\frac{\left (2 b^2\right ) \int x \cos (c+d x) \, dx}{d}+\left (a^2 d\right ) \int \frac{\cos (c+d x)}{x} \, dx\\ &=-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x^2 \cos (c+d x)}{d}-\frac{a^2 \sin (c+d x)}{x}+\frac{2 b^2 x \sin (c+d x)}{d^2}-\frac{\left (2 b^2\right ) \int \sin (c+d x) \, dx}{d^2}+\left (a^2 d \cos (c)\right ) \int \frac{\cos (d x)}{x} \, dx-\left (a^2 d \sin (c)\right ) \int \frac{\sin (d x)}{x} \, dx\\ &=\frac{2 b^2 \cos (c+d x)}{d^3}-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x^2 \cos (c+d x)}{d}+a^2 d \cos (c) \text{Ci}(d x)-\frac{a^2 \sin (c+d x)}{x}+\frac{2 b^2 x \sin (c+d x)}{d^2}-a^2 d \sin (c) \text{Si}(d x)\\ \end{align*}
Mathematica [A] time = 0.274935, size = 97, normalized size = 1. \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}-\frac{2 a b \cos (c+d x)}{d}+\frac{2 b^2 x \sin (c+d x)}{d^2}+\frac{2 b^2 \cos (c+d x)}{d^3}-\frac{b^2 x^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.025, size = 156, normalized size = 1.6 \begin{align*} d \left ({\frac{ \left ( 3\,{c}^{2}+2\,c+1 \right ){b}^{2} \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) }{{d}^{4}}}-4\,{\frac{c{b}^{2} \left ( 1+2\,c \right ) \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{4}}}-2\,{\frac{ab\cos \left ( dx+c \right ) }{{d}^{2}}}-6\,{\frac{{c}^{2}{b}^{2}\cos \left ( dx+c \right ) }{{d}^{4}}}+{a}^{2} \left ( -{\frac{\sin \left ( dx+c \right ) }{dx}}-{\it Si} \left ( dx \right ) \sin \left ( c \right ) +{\it Ci} \left ( dx \right ) \cos \left ( c \right ) \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 7.72093, size = 131, normalized size = 1.35 \begin{align*} \frac{{\left (a^{2}{\left (\Gamma \left (-1, i \, d x\right ) + \Gamma \left (-1, -i \, d x\right )\right )} \cos \left (c\right ) + a^{2}{\left (-i \, \Gamma \left (-1, i \, d x\right ) + i \, \Gamma \left (-1, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{4} + 4 \, b^{2} d x \sin \left (d x + c\right ) - 2 \,{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )}{2 \, d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.78467, size = 293, normalized size = 3.02 \begin{align*} -\frac{2 \, a^{2} d^{4} x \sin \left (c\right ) \operatorname{Si}\left (d x\right ) + 2 \,{\left (b^{2} d^{2} x^{3} + 2 \,{\left (a b d^{2} - b^{2}\right )} x\right )} \cos \left (d x + c\right ) -{\left (a^{2} d^{4} x \operatorname{Ci}\left (d x\right ) + a^{2} d^{4} x \operatorname{Ci}\left (-d x\right )\right )} \cos \left (c\right ) + 2 \,{\left (a^{2} d^{3} - 2 \, b^{2} d x^{2}\right )} \sin \left (d x + c\right )}{2 \, d^{3} x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b x^{2}\right )^{2} \sin{\left (c + d x \right )}}{x^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]